package cn.edu.tjnu.service.impl;

import java.util.List;

import cn.edu.tjnu.dao.IUserInfoDao;
import cn.edu.tjnu.orm.UsersBean;
import cn.edu.tjnu.service.IUserInfoService;

public class UserInfoServiceImpl implements IUserInfoService {

	/**
	 * spring依赖注入 userinfodao的实例对象
	 */
	private IUserInfoDao UserInfoD;

	@Override
	public int saveUserInfo(UsersBean userB) {
		// 调用dao层进行数据保存
		int i = UserInfoD.saveUserInfo(userB);
		return i;
	}

	public IUserInfoDao getUserInfoD() {
		return UserInfoD;
	}

	public void setUserInfoD(IUserInfoDao userInfoD) {
		UserInfoD = userInfoD;
	}

	@Override
	public List<UsersBean> getAllUserInfo(int orderById) {
		// 调用dao层进行查询处理
		return UserInfoD.getAllUserInfo(orderById);
	}

	@Override
	public List<UsersBean> queryAllUserInfoByParams(UsersBean userB) {
		// 根据参数信息进行数据查询
		List<UsersBean> lstUsers = UserInfoD.queryAllUserInfoByParams(userB);
		return lstUsers;
	}

	@Override
	public UsersBean queryUserInfoByUid(Integer uid) {
		// 调用dao层根据用户id进行信息查询
		UsersBean userB = UserInfoD.queryUserInfoByUid(uid);
		return userB;
	}

	@Override
	public int deleteUserInfoByUid(Integer uid) {
		// 调用dao层进行逻辑删除操作
		int i = UserInfoD.deleteUserInfoByUid(uid);
		return i;
	}

}
